#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
    FILE *fp;
    fp=0;
    //记得这里要换模式，改成只读
    if((fp=fopen("/home/hc/Linux_ARM/Linux多线程/13.2聊天室(注册登陆) /user.txt","r"))==0)
    {
        printf("文件打开失败!\n");
        return -1;
    }
    char strBuf[201];
    memset(strBuf,0,sizeof(strBuf));
    while(1)
    {
        if(fgets(strBuf,sizeof(strBuf),fp)==0)break;
        char *name = strtok(strBuf, " ");
        char *passwd = strtok(NULL, " ");
        printf("name: %s, passwd: %s", name, passwd);
    }
    fclose(fp);
}
